package vn.dreamteam.vuigiaitri;

import android.graphics.Bitmap;
import android.view.View;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.LinearLayout;

public class UngDungKhac extends LinearLayout {
	private MainActivity main;
	private View layout;
	public static final String url = "24h.com.vn";

	public UngDungKhac(MainActivity context) {
		super(context);
		main = MainActivity.getInstance();

		layout = View.inflate(main, R.layout.ung_dung_khac, null);
		addView(layout);

		WebView webView = (WebView) layout.findViewById(R.id.web_view);
		webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(false);
		webView.getSettings().setSupportMultipleWindows(false);
		webView.getSettings().setSupportZoom(false);
		webView.setVerticalScrollBarEnabled(false);
		webView.setHorizontalScrollBarEnabled(false);
		webView.setWebViewClient(new myWebClient());
		webView.loadUrl(url);

	}

	public class myWebClient extends WebViewClient {
		@Override
		public void onPageStarted(WebView view, String url, Bitmap favicon) {
			super.onPageStarted(view, url, favicon);
		}

		@Override
		public boolean shouldOverrideUrlLoading(WebView view, String url) {
			view.loadUrl(url);
			return true;

		}
	}
}
